package com.fowo.api.model.inventory.list;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.fowo.api.common.validator.EnumsString;
import javax.validation.constraints.*;
import lombok.Data;

/** 盘点单 导入导出辅助模型 */
@Data
public class InventoryListExcelPo {

  @Size(max = 50, message = "盘点单号长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "盘点单号")
  private String inventoryNumber;

  @NotNull(message = "盘点仓库不能为空")
  @Size(max = 50, message = "盘点仓库长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*盘点仓库")
  private String warehouseStockName;

  @ExcelIgnore
  @ExcelProperty(value = "*盘点仓库")
  private Long warehouseStock;

  @NotBlank(message = "盘点类型不能为空")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*盘点类型")
  private String inventoryType;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "产品种类")
  private String productCategory;

  @NotNull(message = "盘点人不能为空")
  @Size(max = 50, message = "盘点人长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*盘点人")
  private String countPeopleName;

  @ExcelIgnore
  @ExcelProperty(value = "*盘点人")
  private Long countPeople;

  @EnumsString(
    value = { "待盘点_预锁", "待盘点", "盘点中", "已盘点", "已作废", "待审批" },
    message = "盘点状态的可用值为 “待盘点_预锁”, “待盘点”, “盘点中”, “已盘点”, “已作废”, “待审批” 其中之一"
  )
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "盘点状态")
  private String status;

  @Size(max = 50, message = "备注长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "备注")
  private String remark;
}
